#include "internal.h"

static void put_prev_task_dl(struct rq *rq, struct task_struct *p, struct task_struct *next)
{
    struct sched_dl_entity *dl_se = &p->dl;
    struct dl_rq *dl_rq = &rq->dl;

    if (on_dl_rq(&p->dl))
        update_stats_wait_start_dl(dl_rq, dl_se);

    update_curr_dl(rq);

    update_dl_rq_load_avg(rq_clock_pelt(rq), rq, 1);

    if (task_is_blocked(p))
        return;

    if (on_dl_rq(&p->dl) && p->nr_cpus_allowed > 1)
        enqueue_pushable_dl_task(rq, p);
}
